﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SWCInvoice.ViewModel;
using SWCInvoice.Model;

namespace SWCInvoice.Utils {
    public class LoggingManager {

        #region Fields
        /// <summary>
        /// The main view model
        /// </summary>
        MainViewModel _mainViewModel;

        #endregion

        #region Properties

        /// <summary>
        /// The main view model
        /// </summary>
        public MainViewModel MainViewModel {
            get {
                return _mainViewModel;
            }
        }

        #endregion


        #region constructor

        public LoggingManager(MainViewModel mainViewModel)
        {
            _mainViewModel = mainViewModel;
        }

        #endregion

        /// <summary>
        /// Add a new message in the message queue
        /// </summary>
        /// <param name="message">Message object</param>
        public void AddMessage(Message message) {            
            MainViewModel.MessageViewModel.Messages.Add(message);        
        }


        /// <summary>
        /// Clear the message queue
        /// </summary>
        public void ClearMessageQueue() {
            MainViewModel.MessageViewModel.Messages.Clear();
        }

    }
}
